#if !defined(AFX_DLGSCROLLABLE_H__3586FDB6_FC0D_4FF7_BA09_D86692F0006A__INCLUDED_)
#define AFX_DLGSCROLLABLE_H__3586FDB6_FC0D_4FF7_BA09_D86692F0006A__INCLUDED_

#include "../Common/CommonDef.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgScrollable.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CScrollPage dialog

enum
{
	SaveBCE_Other		= -1,
	SaveBCE_Succ		= 0,
	SaveBCE_PageBlank	= 1,
	SaveBCE_Database	= 2,
};


class CScrollPage : public CDialog
{
// Construction
public:
	CScrollPage(UINT nIDTemplate, CWnd* pParentWnd = NULL);   // standard constructor

	BOOL			Create(UINT nIDTemplate, CWnd* pParentWnd, int nIndex);
	int				GetPageIndex(){ASSERT(m_nPangeIndex != -1); return m_nPangeIndex;}
	
	virtual int		SaveData(CString strMRN, int nDiagSN, BOOL bIsDraft)		= 0;
	virtual BOOL	ShowTableData(CString strMRN, int nDiagSN)					= 0;
	virtual BOOL	IsPageCurDayBlank()											= 0;

	virtual BOOL	ShowTableDataWithStartCol(CString strMRN, int nDiagSN, int nStartCol)	{return TRUE;}
	virtual BOOL	SetLastColTitile(CString strDate, int nDiagSN)							{return TRUE;}

	virtual BOOL	ClearData()													{return TRUE;}
	virtual BOOL	EnableInputControls(BOOL bEnable)							{return TRUE;}
	
	static BOOL		PageScoreFieldsCheck(LPVOID pParam, int nLowLimit, int HighLimit, INPUT_FIELD_INFO* pCtrlArrays, int nColCtrlCount);

	int				PageSaveData(CString strMRN, int nDiagSN, BOOL bIsDraft, DWORD dwScaleID, INPUT_FIELD_INFO* ppCtrlArrays[], int nColCtrlCount);
	BOOL			PageShowTableData(CString strMRN, int nDiagSN, DWORD dwScaleID, INPUT_FIELD_INFO* ppCtrlArrays[], int nColCtrlCount, CWnd* pDateLabelArray[], CWnd* pDiagSNArray[], int nStartCol = 2);
	BOOL			PageShowColTitle(CWnd* pDateLabelArray[], CString astrDate[], CWnd* pDiagSNArray[], int anDiagSN[], int nDateCtrlCount);
	BOOL			PageClearData(INPUT_FIELD_INFO* ppCtrlArrays[], int nColCtrlCount, CWnd* pDateLabelArray[], CWnd* pDiagSNArray[], int nDateCtrlCount);
	BOOL			PageEnableInputControls(BOOL bEnable, INPUT_FIELD_INFO* ppCtrlArrays[], int nColCtrlCount);
	BOOL			PageIsAllInputBlank(INPUT_FIELD_INFO ppCtrlArrays[], int nColCtrlCount);

// Implementation
protected:

	virtual BOOL		OnInitDialog();
	void				OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	void				OnSize(UINT nType, int cx, int cy);
	BOOL				OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);

	DWORD				GetStringIdFromScale(DWORD dwScaleID);

private:

	int m_nCurHeight;
	int m_nScrollPos;
	CRect m_rect;
	
	int				m_nPangeIndex;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DLGSCROLLABLE_H__3586FDB6_FC0D_4FF7_BA09_D86692F0006A__INCLUDED_)
